#pragma once

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include <cuda.h>
#include <cuda_runtime.h>

#define SAFE_CALL(err)           __safeCall (err, __FILE__, __LINE__)

inline void __safeCall( cudaError_t err, const char *file, const int line )
{
	if (err != cudaSuccess)
	{
		fprintf(stderr, "%s(%i) : cudaSafeCall() Runtime API error : %s.\n",
			file, line, cudaGetErrorString(err));
		exit(-1);
	}
}